$def with (meterlist)
<script type="text/javascript" src="static/jquery.js"></script>
<script type="text/javascript">
/* Taken from http://www.somacon.com/p143.php */
function getCheckedValue(radioObj) {
	if(!radioObj) {
		return "";
        }
	var radioLength = radioObj.length;
	if(radioLength == undefined) {
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
        }
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}

function extractData() {
   meterID = getCheckedValue(document.getElementsByName("meterSelector"));
   endDate = getCheckedValue(document.getElementsByName("endDate"));
   endDateText = jQuery("#endDateText").val();
   outputPeriod = getCheckedValue(document.getElementsByName("outputPeriod"));
   summaryType = getCheckedValue(document.getElementsByName("summaryType"));
   if (endDate=="Custom") {
      endDateVal = endDateText;
   }
   else {
      endDateVal = "Now";
   }
   resultsURL="/getdata?meter="+meterID+"&outputPeriod="+outputPeriod+"&summaryType="+summaryType+"&endDate="+endDateVal;
   jQuery("#resultsDiv").load(resultsURL);
   
}

function setDateRange() {
   meterID = getCheckedValue(document.getElementsByName("meterSelector"));
   resultsURL="/getdates?meter="+meterID;
   jQuery('#dateRangeDiv').load(resultsURL);
}

jQuery(document).ready(function() {
      setDateRange();
});


</script>
<h2>List Readings - Select Meter</h2>
<div id="selectData" style="border:2px solid #ff0000;">
  <p>Select Meter:-
  $for meter in meterlist:
     <input type="radio" name="meterSelector" 
	    value="$meter.id" 
	    id="meter_$meter.id"
	    onClick="setDateRange()"/> $meter.description
  <script>document.getElementById("meter_0").checked=true;</script>
  </p>
  <div id="dateRangeDiv">
  </div>
  <p>End Date:-
  <input type="radio" value="Now" name="endDate" checked
         onClick="jQuery('#endDateText').attr('disabled',false)"/> Now
  <input type="radio" value="Custom" name="endDate"
	 onClick="jQuery('#endDateText').attr('disabled',false)"/> Custom
  <input type="text"  value="yyyy-mm-dd" id="endDateText"  
	 onFocus="jQuery('[name=endDate]').attr('checked',true);"/> (yyyy-mm-dd)
  </p>
  <p>Period:-
  <input type="radio" value="Day" name="outputPeriod"/> Day
  <input type="radio" value="Month" name="outputPeriod" checked  /> Month
  <input type="radio" value="Year"  name="outputPeriod"  /> Year
  <input type="radio" value="Custom"  name="outputPeriod"  /> Custom
  </p>
</div>
<div id="setSummaryControls" style="border:2px solid #ff0000;">
  <p>Data Summary Type:-
  <input type="radio" name="summaryType" value="rawData"/> Raw Data
  <input type="radio" name="summaryType" value="dailyAverage" checked/> Daily
  <input type="radio" name="summaryType" value="weeklyAverage" /> Weekly
  <input type="radio" name="summaryType" value="monthlyAverage" /> Monthly
  </p>
</div>
<div id="submitControls">
  <input type="button" name="submitButton"
	 value="Extract Data"
	 onClick="extractData()">
</div>
<div id="resultsDiv" style="border:2px solid #0000ff;">
</div>
